%%% ====================================================================
%%% @AMSTeX-style-file{
%%%   filename  = "ams-j.sty",
%%%   version   = "2.1f",
%%%   date      = "1997/10/02",
%%%   time      = "16:53:20",
%%%   checksum  = "32033 414 1082 14923",
%%%   author    = "American Mathematical Society",
%%%   address   = "PO Box 6248, Providence, RI 02940, USA",
%%%   email     = "tech-support@ams.org (Internet)",
%%%   supported = "yes",
%%%   keywords  = "",
%%%   abstract  = "This is an AMSTeX documentstyle. It uses the amsppt
%%%                documentstyle as a base and adds a few refinements
%%%                to give printed documents the visual form used for
%%%                final publication of AMS journal articles. There are
%%%                also documentstyles for individual AMS journals that
%%%                input this documentstyle and add journal-specific
%%%                information (ISSN, journal name, etc).",
%%%   docstring = "The checksum field above contains: CRC-16 checksum,
%%%                number of lines, number of words, and number of
%%%                characters, as produced by Robert Solovay's checksum
%%%                utility.",
%%% }
%%% ====================================================================

%    Input the AMS preprint style (checking first to see if
%    it's preloaded).
\def\next{AMSPPT}
\ifx\styname\next \else\input amsppt.sty \relax\fi

\catcode`\@=11

\indenti=3pc

\font@\fourteenbf=cmbx10 scaled \magstep2

\newtoks\sevenpoint@
\def\sevenpoint{\normalbaselineskip9\p@
 \textonlyfont@\rm\sevenrm \textonlyfont@\it\sevenit
 \textonlyfont@\sl\sevensl \textonlyfont@\bf\sevenbf
 \textonlyfont@\smc\sevensmc \textonlyfont@\tt\seventt
  \textfont\z@\sevenrm \scriptfont\z@\sixrm
       \scriptscriptfont\z@\fiverm
  \textfont\@ne\seveni \scriptfont\@ne\sixi
       \scriptscriptfont\@ne\fivei
  \textfont\tw@\sevensy \scriptfont\tw@\sixsy
       \scriptscriptfont\tw@\fivesy
  \textfont\thr@@\sevenex \scriptfont\thr@@\sevenex
   \scriptscriptfont\thr@@\sevenex
  \textfont\itfam\sevenit \scriptfont\itfam\sevenit
   \scriptscriptfont\itfam\sevenit
  \textfont\bffam\sevenbf \scriptfont\bffam\sixbf
   \scriptscriptfont\bffam\fivebf
  \textfont\msbfam\sevenmsb \scriptfont\msbfam\fivemsb
   \scriptscriptfont\msbfam\fivemsb
 \setbox\strutbox\hbox{\vrule height7\p@ depth3\p@ width\z@}%
 \setbox\strutbox@\hbox{\raise.5\normallineskiplimit\vbox{%
   \kern-\normallineskiplimit\copy\strutbox}}%
 \setbox\z@\vbox{\hbox{$($}\kern\z@}\bigsize@1.2\ht\z@
 \normalbaselines\sevenrm\dotsspace@1.5mu\ex@.2326ex\jot3\ex@
 \the\sevenpoint@}
%  added \msbfam to \sevenpoint so that \Bbb can be used in running heads
%  when they are set to \sevenpoint; bnb, 10Apr96

\def\headlinefont@{\sevenpoint}
\def\foliofont@{\sevenrm}

%    Issue publication info

%    \issueinfo{330}% volume number
%    {2}% issue number
%    {July}% month
%    {1995}% year
%
%    \copyrightinfo{1995}{American Mathematical Society}
%
%    \pagespan{START}{END} % not needed for all journals

\define\issueinfo#1#2#3#4{%
  \def\issuevol@{#1}\def\issueno@{#2}%
  \def\issuemonth@{#3}\def\issueyear@{#4}}

%    For a translation, give the information for the original language
%    publication:
\define\originfo#1#2#3#4{\def\origvol@{#1}\def\origno@{#2}%
  \def\origmonth@{#3}\def\origyear@{#4}}

%    Copyright year is presumably always the same as issue year? But
%    just to be safe, let's allow it to be specified separately. It is
%    probably more natural anyway, from the user's perspective, to give
%    the copyright year in the same command when giving the name of the
%    copyright holder.
\define\copyrightinfo#1#2{\def\copyrightyear{#1}\def\crholder@{#2}}

\define\pagespan#1#2{\pageno=#1\def\start@page{#1}\def\end@page{#2}}

%    Publisher Item Identifier (we started using them in journal logos
%    as of January 1997).
\define\PII#1{\def\@PII{#1}}

%    Set default values:
\issueinfo{00}{0}{}{1997}
\originfo{00}{0}{}{1997}
\copyrightinfo{\issueyear@}{American Mathematical Society}
\pagespan{000}{000}
\pageno=1 % reset the actual counter to a more sensible value
\PII{\issn@(\issueyear@)0000-0}

%    Define a logo for the top of the first page.

\def\nojourlogo{\let\jourlogo\empty@}

\def\journame{AMS JOURNAL STYLE}
\def\volinfo{Volume \issuevol@, Number \number\issueno@,
  \issuemonth@\ \issueyear@}
\let\pageinfo\empty@
\let\jourlogoextra@\empty@
\let\jourlogoright@\empty@

\def\jourlogofont@{\sixrm\baselineskip7\p@\relax}
\def\jourlogo{%
  \vbox to\headlineheight{%
%    Cancel odd parameter settings that might be in effect if the output
%    routine is invoked in the middle of a roster or whatnot.
    \parshape\z@ \leftskip\z@ \rightskip\z@
    \parfillskip\z@ plus1fil\relax
    \jourlogofont@ \frenchspacing
    \line{\vtop{\parindent\z@ \hsize=.5\hsize
%    Leave a hook for something extra at the bottom of the series logo;
%    for book reviews, the copyright line may be inserted here.
      \journame\newline\volinfo\pageinfo\jourlogoextra@\endgraf\vss}%
      \hfil
%    If there is a right-hand side for the series logo (e.g., in
%    translation journals), put it as another \vtop here.
      \jourlogoright@
    }%
    \vss}%
}

\def\flheadline{\jourlogo} \let\frheadline\flheadline

\def\issn#1{\gdef\issn@{#1}}
\issn{0000-0000}

%  The copyright block takes the place of the AMS-TeX logo; otherwise the
%  AMSPPT.STY output routine does what we want.

\def\copyrightline@{%
  \rightline{\sixrm \textfont2=\sixsy \copyright\copyrightyear\ \crholder@}}

\def\logo@{\copyrightline@}

%    Dummy definition of \keyboarder, for now [mjd,1995/04/03]
\def\keyboarder#1{}%

\let\thedate@\empty@
\def\date#1\enddate{\gdef\thedate@{%
  \eightpoint Received by the editors \ignorespaces#1\unskip.}}

\let\thededicatory@\empty@
\def\dedicatory #1\enddedicatory{\gdef\thededicatory@{{\vskip10pt
  \eightpoint\it \raggedcenter@#1\endgraf}}}

\def\preabstract{}

\let\thecommby@=\empty@
\def\commby #1\endcommby{\gdef\thecommby@{{\vskip1pc
  \eightpoint \raggedcenter@(Communicated by #1)\endgraf}}}

\def\title{\let\savedef@\title
  \def\title##1\endtitle{\let\title\savedef@
% Save the title text for later use (e.g., table of contents).
% Can't use a box for this purpose. [mjd,1996/10/10]
    \def\thetitle@{##1}%
    \global\setbox\titlebox@\vtop{\tenpoint\bf
      \raggedcenter@
      \frills@\uppercasetext@{##1}\endgraf}%
    \ifmonograph@ \edef\next{\the\leftheadtoks}%
      \ifx\next\empty@
      \leftheadtext{##1}\fi
    \fi
    \edef\next{\the\rightheadtoks}\ifx\next\empty@ \rightheadtext{##1}\fi
  }%
  \nofrillscheck\title}

\def\author#1\endauthor{%
% Save the argument for later use (e.g., table of contents)
  \def\theauthor@{#1}%
  \global\setbox\authorbox@
  \vbox{\eightpoint\raggedcenter@
    \uppercasetext@{#1}\endgraf}\relaxnext@
  \edef\next{\the\leftheadtoks}\ifx\next\empty@\leftheadtext{#1}\fi}


%    Add \commby to the topmatter
\outer\def\endtopmatter{\add@missing\endabstract
  \edef\next{\the\leftheadtoks}%
  \ifx\next\empty@
    \expandafter\leftheadtext\expandafter{\the\rightheadtoks}\fi
  \ifx\thedate@\empty@\else \makefootnote@{}{\thedate@}\fi
  \ifx\thesubjclass@\empty@\else \makefootnote@{}{\thesubjclass@}\fi
  \ifx\thekeywords@\empty@\else \makefootnote@{}{\thekeywords@}\fi
  \ifx\thethanks@\empty@\else \makefootnote@{}{\thethanks@}\fi
  \inslogo@
  \pretitle
  \begingroup % to localize variant topskip
    \topskip42pt
    \box\titlebox@
  \endgroup
  \preauthor
  \ifvoid\authorbox@\else \vskip2pc\unvbox\authorbox@\fi
  \ifx\thecommby@\empty@\else \thecommby@\fi
  \ifx\thededicatory@\empty@\else \thededicatory@\fi
  \setabstract@
  \ifvoid\tocbox@\else\vskip1.5pcplus.5pc\unvbox\tocbox@\fi
  \prepaper
  \vskip2pcplus1pc\relax
}

\def\setabstract@{%
  \preabstract
  \ifvoid\abstractbox@\else
       \vskip17ptplus.5pc\unvbox\abstractbox@ \fi
}

%    Difference from amsppt.sty:
%    - takes argument to allow uppercasing, not separate begin/end tags
\def\specialheadfont@{\tenpoint\rm}
\let\specialhead\relax
\outer\def\specialhead#1\endspecialhead{%
  \add@missing\endroster \add@missing\enddefinition
  \add@missing\enddemo \add@missing\endexample
  \add@missing\endproclaim
  \penaltyandskip@{-200}\aboveheadskip
  \begingroup\interlinepenalty\@M\rightskip\z@ plus\hsize
  \let\\\linebreak
  \specialheadfont@\raggedcenter@\noindent
	\uppercase{#1}\endgraf\endgroup\nobreak\vskip\belowheadskip}

%    Difference from amsppt.sty:
%    - adds \varindent@
\let\subsubhead\relax
\outer\def\subsubhead{%
  \add@missing\endroster \add@missing\enddefinition
  \add@missing\enddemo
  \add@missing\endexample \add@missing\endproclaim
  \let\savedef@\subsubhead \let\subsubhead\relax
  \def\subsubhead##1\endsubsubhead{\restoredef@\subsubhead
    \penaltyandskip@{-50}\subsubheadskip
    {\def\usualspace{\/{\subsubheadfont@\enspace}}%
     \varindent@\subsubheadfont@##1\unskip\frills@{.\enspace}}\ignorespaces}%
  \nofrillscheck\subsubhead}

\long\def\ext #1\endext{\block #1\endblock}

\def\qed{\ifhmode\unskip\nobreak\fi\hfill
  \ifmmode\square\else$\m@th\square$\fi}

\newskip\prexcaskip  \prexcaskip=\medskipamount
\def\xcaheadfont@{\bf}
\outer\def\xca{\let\savedef@\xca \let\xca\relax
  \add@missing\endproclaim \add@missing\endroster
  \add@missing\endxca \envir@stack\endxca
   \def\xca##1{\restoredef@\xca
     \penaltyandskip@{-100}\prexcaskip
        \bgroup{\def\usualspace{{\xcaheadfont@\enspace}}%
        \varindent@\xcaheadfont@\ignorespaces##1\unskip
        \frills@{.\xcaheadfont@\enspace}}%
        \ignorespaces}%
  \nofrillscheck\xca}
\def\endxca{\egroup\revert@envir\endxca
  \par\medskip}


%    Expand rosters to three item levels
%    This is identical to code in ams-spec.sty except for the width setting
%    of \rosteritemitemitemwd (here "ii"; "iii" in ams-spec.sty).
\newdimen\rosteritemsep
\rosteritemsep=.5pc

\newdimen\rosteritemitemwd
\newdimen\rosteritemitemitemwd

\newbox\setwdbox
\setbox\setwdbox\hbox{0.}\rosteritemwd=\wd\setwdbox
\setbox\setwdbox\hbox{0.\hskip.5pc(c)}\rosteritemitemwd=\wd\setwdbox
\setbox\setwdbox\hbox{0.\hskip.5pc(c)\hskip.5pc(ii)}%
  \rosteritemitemitemwd=\wd\setwdbox

%    Differences from amsppt.sty:
%    - adds \itemitem, \itemitemitem
%    - omits \enspace before item label
%    - omits \smallskip following item (\rosterskip@ is place marker)
\let\rosterskip@\empty@
\def\roster{%
  \envir@stack\endroster
  \edef\leftskip@{\leftskip\the\leftskip}%
  \relaxnext@
  \rostercount@\z@% Initialize \rostercount@ to 0.
  \def\item{\FN@\rosteritem@}%
  \def\itemitem{\FN@\rosteritemitem@}%
  \def\itemitemitem{\FN@\rosteritemitemitem@}%
  \DN@{\ifx\next\runinitem\let\next@\nextii@
    \else\let\next@\nextiii@
    \fi\next@}%
  \DNii@\runinitem% If \runinitem occurs, \nextii@ must kill it off.
    {\unskip% This unskips any space before the original \roster.
     \DN@{\ifx\next[\let\next@\nextii@
       \else\ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi
       \fi\next@}%
     \DNii@[####1]{\rostercount@####1\relax
       \therosteritem{\number\rostercount@}~\ignorespaces}%
     \def\nextiii@"####1"{{\rm####1}~\ignorespaces}%
     \def\nextiv@{\therosteritem1\rostercount@\@ne~}%
     \par@\firstitem@false% Before doing any of this we still change
     \FN@\next@}%      End of definition of \nextii@\runinitem.
  \def\nextiii@{\par\par@% End the present paragraph, change \everypar
    \penalty\@m\rosterskip@\vskip-\parskip
    \firstitem@true}%
  \FN@\next@}

%    Differences from amsppt.sty:
%    - \leftskip = .5pc, not .5em
\def\rosteritem@{\iffirstitem@\firstitem@false
  \else\par\vskip-\parskip
  \fi
  \leftskip\rosteritemwd \advance\leftskip\normalparindent
  \advance\leftskip.5pc \noindent
  \DNii@[##1]{\rostercount@##1\relax\itembox@}%
  \def\nextiii@"##1"{\def\therosteritem@{\rm##1}\itembox@}%
  \def\nextiv@{\advance\rostercount@\@ne\itembox@}%
  \def\therosteritem@{\therosteritem{\number\rostercount@}}%
  \ifx\next[\let\next@\nextii@
  \else\ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi
  \fi\next@}

%    Differences from amsppt.sty:
%    - \skip after label = .5pc, not \enspace
\def\itembox@{\llap{\hbox to\rosteritemwd{\hss
  \kern\z@ % kern to thwart \unskip in \rom
  \therosteritem@}\hskip.5pc}\ignorespaces}

%    Differences from amsppt.sty:
%    - period after, no parentheses around label
\def\therosteritem#1{\rom{\ignorespaces#1.\unskip}}

%    Two new levels.
\def\rosteritemitem@{\iffirstitem@\firstitem@false
  \else\par\vskip-\parskip
  \fi
  \leftskip\rosteritemitemwd \advance\leftskip\normalparindent
  \advance\leftskip.5pc \noindent
  \DNii@[##1]{\rostercount@##1\relax\itemitembox@}%
  \def\nextiii@"##1"{\def\therosteritemitem@{\rm##1}\itemitembox@}%
  \def\nextiv@{\advance\rostercount@\@ne\itemitembox@}%
  \def\therosteritemitem@{\therosteritemitem{\number\rostercount@}}%
  \ifx\next[\let\next@\nextii@
  \else\ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi
  \fi\next@}

\def\itemitembox@{\llap{\hbox to\rosteritemitemwd{\hss
  \kern\z@ % kern to thwart \unskip in \rom
  \therosteritemitem@}\hskip.5pc}\ignorespaces}

\def\therosteritemitem#1{\rom{(\ignorespaces#1\unskip)}}

\def\rosteritemitemitem@{\iffirstitem@\firstitem@false
  \else\par\vskip-\parskip
  \fi
  \leftskip\rosteritemitemitemwd \advance\leftskip\normalparindent
  \advance\leftskip.5pc \noindent
  \DNii@[##1]{\rostercount@##1\relax\itemitemitembox@}%
  \def\nextiii@"##1"{\def\therosteritemitemitem@{\rm##1}\itemitemitembox@}%
  \def\nextiv@{\advance\rostercount@\@ne\itemitemitembox@}%
  \def\therosteritemitemitem@{\therosteritemitemitem{\number\rostercount@}}%
  \ifx\next[\let\next@\nextii@
  \else\ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi
  \fi\next@}

\def\itemitemitembox@{\llap{\hbox to\rosteritemitemitemwd{\hss
  \kern\z@ % kern to thwart \unskip in \rom
  \therosteritemitemitem@}\hskip.5pc}\ignorespaces}

\def\therosteritemitemitem#1{\rom{(\ignorespaces#1\unskip)}}

\def\endroster{\relaxnext@
  \revert@envir\endroster % restore \envir@end
  \par\leftskip@% End the paragraph, and restore the \leftskip.
  \penalty-50 % \vskip-\parskip% Add a good break
  \DN@{\ifx\next\Runinitem\let\next@\relax
    \else\nextRunin@false\let\item\plainitem@% Otherwise, set
      \ifx\next\par% moreover, if \endroster is followed by \par,
        \DN@\par{\everypar\expandafter{\the\everypartoks@}}%
      \else% but if the \endroster isn't followed by a new paragraph,
        \DN@{\noindent\everypar\expandafter{\the\everypartoks@}}%
      \fi
    \fi\next@}%
  \FN@\next@}

\widestnumber\key{99}

\catcode`\@=13

%    Input local initialization file; for the public distribution,
%    this will be minimal, but it provides a hook for incorporation
%    of special fonts and other production details and thus permits
%    the use of the same version of this calling file in both
%    environments.
\input ams-j.sti

\def\amsversion{2.1f}
\endinput
